﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Media;

namespace ChromaCode.Models
{
    /// <summary>
    /// The possible types of highlighting rule
    /// </summary>
    internal enum RuleType
    {
        /// <summary>
        /// This rule contains a list of words to highlight
        /// </summary>
        WordHighlighter = 0,

        /// <summary>
        /// This rule contains a start and end delimiter to define a region to highlight
        /// </summary>
        GroupHighlighter = 1,

        /// <summary>
        /// This rule contains a list of characters to highlight
        /// </summary>
        CharacterHighlighter = 2,

        /// <summary>
        /// This rule contains a regular expression to apply for highlighting
        /// </summary>
        RegExpHighlighter = 4
    }

    /// <summary>
    /// Highlighting rules
    /// </summary>
    internal abstract class Rule
    {
        /// <summary>
        /// The type of rule we represent
        /// </summary>
        public RuleType TypeOfRule
        {
            get;
            set;
        }

        /// <summary>
        /// Whether or not this rule is currently active
        /// </summary>
        public bool Active
        {
            get;
            set;
        }

        /// <summary>
        /// Whether or not to make the text that matches this rule bold
        /// </summary>
        public bool Bold
        {
            get;
            set;
        }

        /// <summary>
        ///  Whwther or not to make the text that matches this rule italic
        /// </summary>
        public bool Italic
        {
            get;
            set;
        }

        /// <summary>
        /// Whether or not to make the text that matches this rule underline
        /// </summary>
        public bool Underline
        {
            get;
            set;
        }

        /// <summary>
        /// The colour to apply to the text that matches this rule
        /// </summary>
        public Brush Color
        {
            get;
            set;
        }  
    }
}
